home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / pc / explorer / wave.dxr / 00087.ls < prev    next >
Encoding:
Text File  |  1997-07-22  |  1003 b   |  33 lines

  1. on mouseUp
  2.   set the trails of sprite 19 to 1
  3.   if field "A" > 5 then
  4.     put 5 into field "A"
  5.   end if
  6.   if field "A" < -5 then
  7.     put -5 into field "A"
  8.   end if
  9.   set x0 to the locH of sprite 12 + 1
  10.   set y0 to the locV of sprite 12
  11.   repeat with n = 0 to 240
  12.     set the locH of sprite 19 to (2.39999999999999991 * n) + x0
  13.     if the hilite of cast "Sine" then
  14.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(sin(float((field "B" * n * 3.0) + field "C") * PI / 180.0)))
  15.     end if
  16.     if the hilite of cast "Cosine" then
  17.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(cos(float((field "B" * n * 3.0) + field "C") * PI / 180.0)))
  18.     end if
  19.     if the hilite of cast "Tangent" then
  20.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(tan(float((field "B" * n * 3.0) + field "C") * PI / 180.0)))
  21.     end if
  22.     updateStage()
  23.     startTimer()
  24.     repeat while the timer < 1
  25.       nothing()
  26.     end repeat
  27.   end repeat
  28. end
  29.  
  30. on mouseDown
  31.   button()
  32. end
  33.